vec4f vec4f::operator*(mat4f &_param)
{
	vec4f a,b,c,d,temp;

	a.Set(_param.cell[0][0],_param.cell[0][1],_param.cell[0][2],_param.cell[0][3]);
	b.Set(_param.cell[1][0],_param.cell[1][1],_param.cell[1][2],_param.cell[1][3]);
	c.Set(_param.cell[2][0],_param.cell[2][1],_param.cell[2][2],_param.cell[2][3]);
	d.Set(_param.cell[3][0],_param.cell[3][1],_param.cell[3][2],_param.cell[3][3]);

	a*=this->x;
	b*=this->y;
	c*=this->z;
	d*=this->a;

	temp.x = a.x + b.x + c.x + d.x;
	temp.y = a.y + b.y + c.y + d.y;
	temp.z = a.z + b.z + c.z + d.z;
	temp.a = a.a + b.a + c.a + d.a;

	return temp;
}


void vec3f::rotateAround(vec3f &_around, float angle)
{
	mat4f mtx;
	vec4f temp(this);
	
	float c = (float)cos(angle);
	float s = (float)sin(angle);
	
	mtx.Set(0, 
		(_around.x * _around.x) * (1.0f - c) + c, 
		(_around.y * _around.x) * (1.0f - c) + (_around.z * s),
		(_around.z * _around.x) * (1.0f - c) - (_around.y * s),
		0.0f);
	
	mtx.Set(1,
		(_around.x * _around.y) * (1.0f - c) - (_around.z * s),
		(_around.y * _around.y) * (1.0f - c) + c,
		(_around.z * _around.y) * (1.0f - c) + (_around.x * s),
		0.0f);
	
	mtx.Set(2,
		(_around.x * _around.z) * (1.0f - c) + (_around.y * s),
		(_around.y * _around.z) * (1.0f - c) - (_around.x * s),
		(_around.z * _around.z) * (1.0f - c) + c,
		0.0f);
	
	mtx.Set(3, 0,0,0,1);
	
	
	temp = temp*mtx;
	
	this->Set(temp.x,temp.y,temp.z);	
}